package com.dg.param;

import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


@Data
@Builder
public class AclParam {

    private Integer id;

    @NotBlank(message = "权限点名称不能为空")
    @Length(min = 1,max = 20, message = "权限点名称长度需要在1~20之间")
    private String name;

    @NotNull(message = "所属的权限模块不能为空")
    private Integer aclModuleId;

    @NotBlank(message = "要拦截的url不能为空")
    @Length(min = 1, max = 100, message = "url长度需要在1~100之间")
    private String url;

    @NotNull(message = "类型不能为空")
    @Min(value = 1, message = "类型最小为1")
    @Max(value = 3, message = "类型最大为3")
    private Integer type;

    @Min(value = 0, message = "状态最小为0")
    @Max(value = 2, message = "状态最大为2")
    @NotNull(message = "状态不能为空")
    private Integer status;

    @NotNull
    private Integer seq;

    @Length(max = 200, message = "备注长度必须在200个字之内")
    private String remark;

}
